<template>
  <el-dialog title="添加接口分类" :visible.sync="dialogFormVisible" :before-close="handleClose" width="30%">
    <el-form>
      <el-form-item label="分类名称：" :label-width="formLabelWidth">
        <el-input v-model="classificationName" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item label="分类备注：" :label-width="formLabelWidth">
        <el-input v-model="remark" autocomplete="off"></el-input>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="gb()">取 消</el-button>
      <el-button
        type="primary"
        @click="
          dj()
        "
        >确 定</el-button
      >
    </div>
  </el-dialog>
</template>

<script>
export default {
    props:{
        dialogFormVisible:{
            type:Boolean,
        }
    },
  data() {
    return {
      formLabelWidth: "100px",
      classificationName: "",
      remark: "",
    };
  },
  methods: {
    dj() {
      this.$api
        .apiSuiteAdd({
          name: this.classificationName,
          remark: this.remark,
          projectId:this.$store.getters.getProjectId,
        })
        .then((res) => {

          console.log(res);
        })
        .catch((err) => {
          console.log(err);
        });
        this.$emit("changeAddSuitePage");
    },
    gb(){
        this.classificationName='',
        this.remark='',
        this.$emit("changeAddSuitePage");
    },
    handleClose(done) {
        this.classificationName='',
        this.remark='',
        this.$emit("changeAddSuitePage");
      }
  },
};
</script>